A wellbore is a drilled hole or borehole formed through a subterranean zone (e.g., a formation, multiple formations, or a portion of a formation) to recover hydrocarbons in the zone. To form the wellbore, a wellbore drilling system, which can include a drill bit, is lowered into the zone using drill strings. The drill strings are positioned in the wellbore to form an annulus between an outer wall of the drill strings and an inner wall of the wellbore. Drilling fluids (sometimes called drilling muds) are flowed from the surface through the drill strings to the drilling system. The drilling fluids exit the drilling system, e.g., through ports in the drill bits, and flow through the annulus formed between the drill strings and the wellbore to the surface. The drilling fluids serve several functions including, e.g., cooling the drill bits, carrying cuttings to the surface, and other functions. The drilling fluids can be water or oil-based. Because the subterranean zone can include porous rock, the drilling fluids can sometimes be lost into the surround formation when flowing through the annulus.